package jpg1980.gttunes.actions;

import java.util.List;

import jpg1980.gttunes.beans.Car;
import jpg1980.gttunes.beans.Game;
import jpg1980.gttunes.beans.Manufacturer;
import jpg1980.gttunes.beans.TuneBasic;
import jpg1980.gttunes.dao.CarDao;
import jpg1980.gttunes.dao.DaoFactory;
import jpg1980.gttunes.dao.GameDao;
import jpg1980.gttunes.dao.ManufacturerDao;
import jpg1980.gttunes.dao.TuneBasicDao;

import org.apache.log4j.Logger;

import com.opensymphony.xwork2.ActionSupport;

public class GameAction extends ActionSupport
{
	private static final long serialVersionUID = 1L;

	static Logger logger = Logger.getLogger(GameAction.class);

	List<Game> gameList;
	String gameName;

	public String jsonList()
	{
		GameDao gameDao = DaoFactory.getDaoFactory().getGameDao();
		gameList = gameDao.readAll();

		return "json_list";
	}
	
	public String jsonListByGameName()
	{
		GameDao gameDao = DaoFactory.getDaoFactory().getGameDao();
		gameList = gameDao.readByGameName(gameName);

		return "json_list_by_game_name";
	}

	public List<Game> getGameList()
	{
		return gameList;
	}

	public void setGameList(List<Game> gameList)
	{
		this.gameList = gameList;
	}	

	public String getGameName()
	{
		return gameName;
	}

	public void setGameName(String gameName)
	{
		this.gameName = gameName;
	}

}
